Fix recompiles where overrides changed
authorAlex Crichton <alex@alexcrichton.com>
Fri, 9 Oct 2015 21:15:25 +0000 (14:15 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 9 Oct 2015 21:23:20 +0000 (14:23 -0700)
commitef3215ab0b8a4388d39b303a2502d78fd8da79ae
treeef6e0bbc0fdd5bf8433a562b4684e3bde518b245
parent9d3196c9bff00ae39327314c481c999155647ad5
Fix recompiles where overrides changed

This commit causes a recompile to be triggered if the overridden version of a
build script changed since it was last run. Previously this wasn't tracked very
well due to fingerprints not accounting for the right data.

There are a few architectural changes here which were made to prepare for this:

* The unit of work for "running a build script" is now emitted as dependency
  regardless of whether a build script is overridden or not. Previously it was
  omitted if overridden.
* This unit of work has 0 dependencies if it is overridden (as we know the
  output) and otherwise has the normal set of dependencies.
* The fingerprint calculation was updated to recognize when a build script
  execution is overridden and instead consider the overridden value as input to
  the fingerprint. This means that if the overridden values change they will
  trigger a recompile.
* The "prepare a build script to run" step now emits a noop if the execution of
  the build script is overridden.

After putting all that together, this commit ...

Closes #2042
src/cargo/ops/cargo_rustc/context.rs
src/cargo/ops/cargo_rustc/custom_build.rs
src/cargo/ops/cargo_rustc/fingerprint.rs
tests/test_cargo_compile_custom_build.rs